<?php

namespace app\data\model;

use think\admin\Model;

/**
 * 商城商品主模型
 * Class ShopGoods
 * @package app\data\model
 */
class StoreGoods extends Model
{
    protected $table = "store_goods";

    public function models(){
        return $this->hasMany(GoodsModels::class,'goods_id')->where('status',1)->order('sort asc,id desc');
    }

    public function getSpecsAttr($value,$data){
        return GoodsAttributeRelations::with(['attribute'])->where('goods_id',$data['id'])->select()->toArray();
    }

   
}